package site.jlopen.kuscia.model.task.param.clusterDevices;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson2.JSON;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SfClusterDescDevices {

	private String name;

	private String type;

	private List<String> parties;

	private Object config;

	public SfClusterDescDevices() {
		super();
	}

	public SfClusterDescDevices(String name, String type) {
		super();
		this.name = name;
		this.type = type;
	}

	public SfClusterDescDevices spu() {
		this.name = "spu";
		this.type = "spu";
		//this.addSpuConfig();
		String configStr = JSON.toJSONString(new ClusterSpuDeviceConfig());
		this.config = configStr;
		return this;
	}

	public SfClusterDescDevices heu() {
		this.name = "heu";
		this.type = "heu";
		//this.addHeuConfig();
		String configStr = JSON.toJSONString(new ClusterHeuDeviceConfig());
		this.config = configStr;
		return this;
	}
	
	public SfClusterDescDevices addPartie(String partie) {
		if(null == this.parties) {
			this.parties = new ArrayList<String>();
		}
		this.parties.add(partie);
		return this;
	}
	
	/*public SfClusterDescDevices addSpuConfig() {
		this.config = new ClusterSpuDeviceConfig();
		return this;
	}
	
	public SfClusterDescDevices addHeuConfig() {
		this.config = new ClusterHeuDeviceConfig();
		return this;
	}*/
}
